<template>
  <div class="admin">
    <!-- 面包屑导航 -->
    <el-bread></el-bread>
    <!-- 添加按钮 -->
    <el-row>
      <el-button @click="getDialog" type="primary" plain 
        >添加</el-button
      >
    </el-row>
    <!-- 数据表格 -->
    <v-list @edit="edit"></v-list>
    <!-- dialog 提示框 -->
    <v-dialog @cancel="cancel" ref="dioInfo" :isShow="isShow" :isAdd="isAdd"></v-dialog>
  </div>
</template>
<script>
import vDialog from "./dialog.vue";
import vList from "./list.vue";
export default {
  data() {
    return {
      isShow: false,
      isAdd: false,
    };
  },
  components: { vDialog, vList },
  mounted() {},
  methods: {
    //点击添加按钮打开dialog弹窗
    getDialog() {
      this.isShow = true;
      //告诉你是一个编辑弹窗
      this.isAdd = true;
    },
    //表格字传父事件
    edit(e) {
      this.isShow = true;
      //告诉你是一个编辑弹窗
      this.isAdd = false;
      this.$refs.dioInfo.lookup(e)
    },
    cancel(e){
        this.isShow = e
    }
  },
};
</script>
<style scoped>
</style>